#pragma once
#include<iostream>
#include<cstring>
using namespace std;
//测试使用cstring方法
void CstringFuncTest() {
	char a[20] = "abcdefg";
	char b[20] = "hijk";

	cout << "a: " << a << " b: " << b << endl;

	cout << "strcmp(a, b)比较 a, b 大小(字典序列): " << strcmp(a, b) << endl
		<< "返回规则: a > b : > 0; a == b: =0; a < b: < 0" << endl;;

	cout << "strlen(a): 获得字符数组 a 的长度: " << strlen(a) << endl;

	strcat_s(a, b);
	cout << "strcat_s(a, b): 将字符数组 b, 拼接到 a 上: "
		<< "a: " << a << "\tb: " << b << endl;

	strcpy_s(a, b);
	cout << "strcpy_s(a, b): 将字符数组 b, 拷贝到 a 上: "
		<< "a: " << a << "\tb: " << b << endl;
}

void TravelCharArray() {
	char a[10] = "abcdefg";
	for (int i = 0; i < strlen(a); i++) {
		cout << a[i];
	}
	cout << endl;
}